package ModLayer;

/**
 * Write a description of class Product here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Product
{
    private String name;
    private String id;
    private String description;
    private int stockDIY;
    private int stockBath;
    private int stockKit;
    private int stock;
    private double price;
    private double leaseprice;
    private boolean sellable;
    private boolean leaseable;
    private double discount;
    private int pallet;
    private double palletDiscount;
    
    public Product(String n,String id, String d, boolean sell, boolean lease, 
    double price, double leaseprice, int stockDIY, int stockBath, int stockKit)
    {
        this.name = n;
        this.id = id;
        this.description = d;
        this.stockDIY = stockDIY;
        this.stockBath = stockBath;
        this.stockKit = stockKit;
        this.stock = stockDIY + stockKit +stockBath;
        this.sellable = sell;
        this.leaseable = lease;
        this.price = price;
        this.leaseprice = leaseprice;
        pallet = 1;
        palletDiscount = price;
    }
    
    public void setPallet(int discount)
    {
        this.palletDiscount = discount;
    }

    public int getPallet()
    {
        return pallet;
    }
    
    public void setPalletDiscount(double discount)
    {
        this.palletDiscount = discount;
    }

    public double getPalletDiscount()
    {
        return palletDiscount;
    }
    
    public void setDiscount(double discount)
    {
        this.discount = discount;
    }

    public double getDiscount()
    {
        return discount;
    }
    
    public void setPrice(double price)
    {
        this.price = price;
    }
    
    public double getPrice(double discount)
    {
        return price/100*(100-discount);
    }
    
    public double getLeasePrice(double discount)
    {
        return leaseprice*(100-discount);
    }
    
    public void setLeasePrice(double amount)
    {
        leaseprice = amount;
    }
    
    public String getID()
    {
        return id;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }

    public int getStock()
    {
        return stock;
    }

    public int getStockDIY()
    {
        return stockDIY;
    }

    public int getStockBath()
    {
        return stockBath;
    }

    public int getStockKit()
    {
        return stockKit;
    }
    
    public void setDescription(String d)
    {
        description = d;
    }

    public void setStockDIY(int amount)
    {
        stockDIY=amount;
        stock += stockDIY;
    }

    public void setStockBath(int amount)
    {
        stockBath=amount;
        stock += stockBath;
    }

    public void setStockKit(int amount)
    {
        stockKit=amount;
        stock += stockKit;
    }

    public boolean getSellable()
    {
        return sellable;
    }

    public void setSellable(boolean amount)
    {
        sellable = amount;
    }

    public boolean getLeaseable()
    {
        return leaseable;
    }

    public void setLeaseable(boolean amount)
    {
        leaseable = amount;
    }
    
    public String getDescription()
    {
        return description;
    }
}